home *** CD-ROM | disk | FTP | other *** search
-
-
-
- CTG(1) USER COMMANDS CTG(1)
-
-
-
- NAME
- ctg - generate pretty class trees from C++ source files
-
- SYNOPSIS
- ctg [ -m ] [ -o _n_a_m_e ] [ -p ] [ -r _n_a_m_e ] [ -s ] [ -S _n_a_m_e ]
- [ -v ] name ...
-
- DESCRIPTION
- ctg reads a number of C++ source files, extracts class und
- struct definitions and generates a graphical representation
- of the resulting class hierarchy as a PostScript source. The
- output may be constrained to a subset of classes according
- to the contents of a given configuration file.
-
- OPTIONS
- If run without options, ctg processes all input files
- silently and writes the generated class tree to the standard
- output.
-
- -m Micro size output. By default ctg uses 80x12 boxes
- and font size 10 for the PostScript output which
- suffices for trees with depth 6. With this option
- 60x10 boxes and font size 8 are used. This might
- suffice for larger class libraries.
-
- -o _n_a_m_e Output file specification. By default ctg writes
- the PostScript source to the standard. With this
- option the output is written to _n_a_m_e.
-
- -p Also include privates. By default ctg ignores
- _p_r_i_v_a_t_e sections within class definitions. With
- this option also private classes are included into
- the hierarchy.
-
- -r _n_a_m_e Root class specification. Only descendants of
- class _n_a_m_e are included into the output. This
- option overrides any root specification in a given
- configuration file. Without this option all
- classes are sons of the overall root *.
-
- -s Also include structs. By default ctg ignores
- struct definitions. With this option also structs
- are included into the hierarchy.
-
- -S _n_a_m_e Configuration file specification. By default ctg
- tries to read the configuration from ~./ctgrc.
- This options causes ctg to read it from the file
- _n_a_m_e.
-
- -v Verbose option. By default ctg processes the input
- files silently. With this option ctg generates
- messages about all actions and writes them to the
-
-
-
- COMMANDS Last change: 25 February 1995 1
-
-
-
-
-
-
- CTG(1) USER COMMANDS CTG(1)
-
-
-
- standard output. If no output file specification
- is given, the PostScript source is written to the
- file _o_u_t._p_s.
-
- FILES
- If the -S option has been omitted, ctg tries to read the
- configuration from ~/.ctgrc. Note that the argument to -r
- overrides a given root specification in the configuration
- file.
-
- A configuration for ctg consists of a number of specifica-
- tion statements which affect the preprocessing stage and the
- PostScript code generation.
-
- Config = { Stmt }.
- Stmt = "preprocess" string
- | "exclude" file_identifier { file_identifier }
- | "root" Node
- | "collapse" class_identifier { class_identifier }.
- Node = (class_identifier | "*")
- [ "(" Node { "," Node } ")" ].
-
- preprocess _s_t_r_i_n_g
-
- In order to enable accurate parsing all sources are prepro-
- cessed before they are passed on ctg's parser. The statement
- specifies a command template used for the invocation of an
- external preprocessor. The template _s_t_r_i_n_g must contain two
- %s fill-ins where at each invocation the first one is
- replaced by the source file name and the second one by the
- preprocessor output file (extension .i required). Example:
- _p_r_e_p_r_o_c_e_s_s "_g_c_c -_E %_s >%_s".
-
- exclude _f_i_l_e__i_d_e_n_t_i_f_i_e_r { _f_i_l_e__i_d_e_n_t_i_f_i_e_r }
-
- This statement specifies a number of header files which will
- be excluded from the final preprocessor output. Typically
- this list consists of C and C++ standard headers. The
- _i_o_s_t_r_e_a_m._h header should always be specified, since it con-
- tains classes with multiple inheritance (see diagnostics).
-
- root _N_o_d_e
-
- The root of the generated class hierarchy is specified with
- this statement. Optionally _c_l_a_s_s__i_d_e_n_t_i_f_i_e_r may be followed
- by a list of (direct) son nodes enclosed in brackets. In
- such a case only these sons are included into the output,
- all other sons do not appear. Each son node may in turn con-
- sist of a _c_l_a_s_s__i_d_e_n_t_i_f_i_e_r and a list of son nodes. The spe-
- cial class node "*" is regarded as the father of all class
- and struct definitions.
-
-
-
-
- COMMANDS Last change: 25 February 1995 2
-
-
-
-
-
-
- CTG(1) USER COMMANDS CTG(1)
-
-
-
- collapse _c_l_a_s_s__i_d_e_n_t_i_f_i_e_r { _c_l_a_s_s__i_d_e_n_t_i_f_i_e_r }
-
- This statement specifies a number of class nodes whose sons
- will not be included in the generated class tree.
-
- EXAMPLE
- $ cat my_ctgrc
- preprocess "gcc -E -I/home/gup/rk/misc/include %s >%s"
- exclude
- iostream.h iomanip.h fstream.h
- assert.h ctype.h errno.h float.h limits.h locale.h math.h
- setjmp.h signal.h stdarg.h stddef.h stdio.h stdlib.h
- string.h time.h
- sys/types.h sys/param.h sys/time.h unistd.h pwd.h
- root * (Preprocessor,
- TObject (FuzzyParser, ClassTree, Scanner)
- )
- $ ctg -o ctg.ps -S my_ctgrc *.cc
-
- DIAGNOSTICS
- Error messages generated by the semantic actions of the
- fuzzy parser:
-
- _d_u_p_l_i_c_a_t_e _c_l_a_s_s _d_e_f_i_n_i_t_i_o_n
- two class definitions with the same identifier
-
- _u_n_d_e_f_i_n_e_d _b_a_s_e _c_l_a_s_s
- definition of a derived class where the anchestor is
- unknown
-
- _m_u_l_t_i_p_l_e _i_n_h_e_r_i_t_a_n_c_e _n_o_t _s_u_p_p_o_r_t_e_d
- class definition with more than one base class (reported
- for iostream.h classes)
-
- Error messages generated by the PostScript code generator:
-
- _t_r_e_e _w_i_d_t_h _e_x_c_e_e_d_s _n
- tree width exceeds paper size
-
- _t_r_e_e _h_e_i_g_h_t _e_x_c_e_e_d_s _n
- tree height exceeds paper size
-
- Fatal errors that should not occur under normal conditions:
-
- file _f_i_l_e, line _l_i_n_e: unhandled exception: _c_o_d_e - exiting
-
- _c_o_d_e = -_2 out of memory
-
- _c_o_d_e = -_2_0_0 scanner could not open source file
-
- _c_o_d_e = -_2_0_1 hash table error
-
-
-
-
- COMMANDS Last change: 25 February 1995 3
-
-
-
-
-
-
- CTG(1) USER COMMANDS CTG(1)
-
-
-
- BUGS
- ctg does not support multiple inheritance, so only _t_r_u_e
- trees are generated.
-
- AUTHOR
- Rainer Koppler (rk@gup.uni-linz.ac.at), v1.0, 21/02/95
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COMMANDS Last change: 25 February 1995 4
-
-
-
-